package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

func main() {
	// 测试读取用户输入的内容
	// 先定义个 读取reader

	for {
		reader := bufio.NewReader(os.Stdin)
		// buf := [512]byte{}
		inputString, err := reader.ReadString('\n')
		if err != nil {
			fmt.Println("read input error:", err.Error())
			return
		}
		inputString = strings.Trim(inputString, "\n\r")
		if strings.ToLower(inputString) == "q" {
			fmt.Println("byebye !")
			return
		}
		fmt.Println(inputString)
	}
}
